package pacman.objects;

import java.awt.Graphics;

/**
 * This class represents all objects
 * @author Carlos Massera Filho
 */
public abstract class Objects {
  /**
   * This is the size in pixels of a cell
   */
  protected final int cellSize = 40;
  /**
   * The X and Y position of the object
   */
  protected float posX,
                  posY;
  /**
   * the visibility state of the object
   */
  protected boolean visible;

  /**
   * Set the object to target position
   * @param posX X coordinate
   * @param posY Y coordinate
   */
  public void setPosition(float posX, float posY)
  {
    this.posX = posX;
    this.posY = posY;
  }

  /**
   * hide the object
   */
  public void hide()
  {
    visible = false;
  }

  /**
   * show the object
   */
  public void show()
  {
    visible = true;
  }

  /**
   * get the X coordinate position
   * @return X coordinate
   */
  public float getPosX() {
    return posX;
  }

  /**
   * get the Y coordinate position
   * @return Y coordinate
   */
  public float getPosY() {
    return posY;
  }

  /**
   * get the visibility of the object
   * @return the visibility state of the object
   */
  public boolean isVisible() {
    return visible;
  }

  /**
   * Printf the object in screen
   * @param g
   */
  public abstract void render(Graphics g);

  /**
   * @return the cellSize
   */
  public int getCellSize() {
    return cellSize;
  }
}
